package com.king.bean.msg;

import com.king.bean.entity.Article;
import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.List;
import java.util.Map;

@XStreamAlias("xml")
public class WxNewsMessage extends WxBaseMessage {

    @XStreamAlias("ArticleCount")
    private int articleCount;

    @XStreamAlias("Articles")
    private List<Article> articles;

    public int getArticleCount() {
        return articleCount;
    }

    public void setArticleCount(int articleCount) {
        this.articleCount = articleCount;
    }

    public List<Article> getArticles() {
        return articles;
    }

    public void setArticles(List<Article> articles) {
        this.articles = articles;
    }

    public WxNewsMessage(Map<String, Object> requestMap, List<Article> articles) {
        super(requestMap);
        this.setMsgType("news");
        this.articles = articles;
        if (articles != null) {
            this.articleCount = articles.size();
        }
    }
}
